@import 'src/styles/const.scss';
@import 'src/styles/const.scss';

$width: 414px;
$height: 736px;
.flex-box{
  display: flex;
}
.form-design {
  height: 100%;
  min-width: 1200px;

  &-control {
    width: 270px;
    min-width: 270px;
  }

  &-item {
    margin: 8px;
    width: 100px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    display: inline-block;
    line-height: 32px;
    height: 32px;
  }
  &-itemicon {
    font-size: 16px;
  }
  &-screen {
    width: $width;
    border: 1px solid $border-color;
    min-height: $height;
    background-color: #ffffff;
    overflow: auto;
  }
  &-screen-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    height: $height;
  }
  &-screen-fixed {
    overflow-y: hidden;
  }
  &-body {
    display: inline-block;
    text-align: center;
    overflow: auto;
    .el-tabs {
      height: 100%;
    }
    .el-tab-pane {
      overflow: auto;
    }
    .el-tabs__nav-wrap {
      margin-bottom: -2px;
    }
  }
  &-pc {
    border: 1px solid $background-blur;
    width: 800px;
    display: inline-block;
    text-align: left;
    margin: 10px auto;
    min-height: 900px;

    &:hover {
      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
    }
  }

  &-json {
    min-height: 900px;
    overflow: auto;
    text-align: left;
    .json-editor, .CodeMirror {
      min-height: 900px;
    }
  }

  &-mobile {
    background-color: #f0f0f0;
    border: 1px solid $border-color;
    border-radius: 64px;
    padding: 0px 16px;
    margin: 0px 32px;
    display: inline-block;
    text-align: left;
    margin: 10px auto;
  }

  &-screen-top {
    height: 100px;
    text-align: center;
    &-bg {
      background-image: url("../assets/image/phone.png");
      background-size: 640px 262px;
      background-position: 0px -400px;
      display: inline-block;
      width: 160px;
      height: 100px;
      margin-top: 10px;
    }
  }

  &-submit {
    padding: 8px;
    background-color: #ffffff;
    border-top: 1px solid $border-color;
    .el-button {
      width: 100%;
    }
  }

  &-screen-footer {
    height: 128px;
    text-align: center;
    &-bg {
      display: inline-block;
      width: 80px;
      height: 80px;
      background: #ffffff;
      border-radius: 50%;
      margin-top: 24px;
    }
  }
  &-tool {
    margin-top: -2px;
    height: 39px;
  }

  &-props {
    width: 400px;
    min-width: 400px;
    overflow-y: auto;
    margin-left: -1px;
    &-panel {
      overflow-y: auto;
    }
    .el-tabs {
      height: 100%;
    }
    .el-tabs--border-card > .el-tabs__content {
      padding: 0;
    }
    .el-form-item {
      .el-input, .el-textarea, .el-input-number {
        width: 100%;
        min-width: 0px;
        max-width: 1000px;
      }
      .el-input-number .el-input {
        width: 100%;
        min-width: 0px;
      }
      .el-radio-group, .el-radio,
      .el-checkbox-group, .el-checkbox {
        line-height: 36px;
      }
    }
  }
}

.form-el {
  position: relative;
  cursor: pointer;
  box-sizing: border-box;
  vertical-align: top;

  &-active, &:hover {
    cursor: pointer;
    position: relative;

    .form-el-border-top, .form-el-border-bottom {
      position: absolute;
      z-index: 999;
      left: 0px;
      right: 0px;
      width: 100%;
      height: 1px;
      border-top: 1px dashed $color-danger;
    }
    .form-el-border-left, .form-el-border-right {
      position: absolute;
      z-index: 999;
      top: 0px;
      bottom: 0px;
      width: 1px;
      height: 100%;
      border-left: 1px dashed $color-danger;
    }
    .form-el-border-top {
      top: 0px;
    }
    .form-el-border-bottom {
      bottom: 0px;
    }
    .form-el-border-left {
      left: 0px;
    }
    .form-el-border-right {
      right: 0px;
    }
    .form-el-tool {
      display: block;
    }
  }
  .form-el-border-top, .form-el-border-bottom, .form-el-border-left, .form-el-border-right {
    display: none;
  }
  &-tool {
    font-size: 20px;
    position: absolute;
    right: 1px;
    top: -16px;
    padding: 4px;
    display: none;
    z-index: 999;
  }
  &-delete {
    background-color: #ffffff;
    color: $color-danger;
    display: inline-block;
  }
  &-drag, &-merge {
    background-color: #ffffff;
    color: $background-blur;
    display: inline-block;
  }
  &-merge-active {
    border: 1px solid $background-blur;
  }
  &-active {
    .form-el-border-top, .form-el-border-bottom, .form-el-border-left, .form-el-border-right {
      display: block;
    }
  }
  &:hover {
    .form-el-border-top, .form-el-border-bottom, .form-el-border-left, .form-el-border-right {
      display: block;
    }
  }

  &-panel {
    width: 100%;
  }
}

.form-title-fixed {
  height: $height;
}

.form-props {
  &-item {
    padding: 8px 8px;
    border-bottom: 1px solid $border-color;
  }
  &-control {
    line-height: 28px;
  }
  &-label {
    font-size: 14px;
    line-height: 28px;
    min-width: 70px;
  }
  &-suffix {
    padding: 0px 8px;
    line-height: 28px;
  }
}

$height: 58px;
.form-el-drop-panel {
  min-height: 600px;
  &.form-dnd-over:after,
  &.form-dnd-enter:after {
    content: '松开鼠标，添加元素';
    display: block;
    height: $height;
    line-height: $height;
    text-align: center;
    font-size: 16px;
    color: $text-second;
    width: 100%;
    border: 1px dashed $color-danger;
  }
}

.form-el {
  &.form-dnd-enter,
  &.form-dnd-over {
    height: auto !important;
  }
  &.form-dnd-drag {
    opacity: 0.5;
  }
  &.form-dnd-enter:after,
  &.form-dnd-over:after {
    content: '松开鼠标，添加元素';
    display: block;
    height: $height;
    line-height: $height;
    text-align: center;
    font-size: 16px;
    color: $text-second;
    width: 100%;
    border: 1px dashed $color-danger;
  }
  .el-form-item {
    margin: 11px 0 !important;
  }

  .fd-form-table .el-table {
    border: 0 !important;
    margin: -1px 0 !important;
    &:after, &:before {
      display: none;
    }
  }
}

.preview-dialog {
  text-align: left;
  .el-dialog__header {
    display: none;
  }
  .el-dialog__body {
    padding-top: 0px;
  }
}

.mobile-preview-dialog {
  background-color: transparent;
  .el-dialog__header {
    display: none;
  }
  .el-dialog,
  .el-dialog__body {
    background-color: transparent;
    border: none;
    box-shadow: none;
  }
}

.form-item-label {
  &-none {
    & > .el-form-item__content {
      margin-left: 0px !important;
    }
    & > .el-form-item__label {
      display: none;
    }
  }
  &-top {
    & > .el-form-item__label {
      display: block;
      width: 100% !important;
      text-align: left;
    }
    & > .el-form-item__content {
      margin-left: 0px !important;
    }
  }
}

.fd-form-item {
  & > .el-form-item {
    display: block;
    width: 100%;
  }
}





